/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Datos;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.StreamCorruptedException;

/**
 *
 * @author sandra
 */
public class CtrlDatos {
Disco d = Disco.getInstance();

    public CtrlDatos() {
    }

    public Object getObject(String path) throws StreamCorruptedException, FileNotFoundException, IOException, ClassNotFoundException {
        return d.getObject(path);
    }/*hay k hacer un catch*/
    
    public String getString(String path) throws IOException{
        return d.getFile(path);
    }

    public void setObject(Object o, String path) throws SecurityException, FileNotFoundException, IOException {
        d.writeObject(o, path);
    }
    
     public void setString(String o, String path) throws IOException {
        d.writeFile(o, path);
    }
    public String getPadre(String st) {
        File fi = new File(st);
        return fi.getParent();
    }
}
